﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

namespace BillingManagment
{
    public partial class AllSellingSlip : System.Web.UI.Page
    {
        DbConnect db;
        protected DataTable dt = new DataTable();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGrid();
            }
        }

        public void BindGrid()
        {
            db = new DbConnect();
            SqlCommand cmd = new SqlCommand("Select S.S_ID,S.Farmer_Id,S.Total_items,S.Total_Amount,S.S_Date,F.Name +' '+F.Village as Name from tbl_Selling S inner join  tbl_Farmer F on F.ID=S.Farmer_ID");
            dt = new DataTable();
            dt = db.GetDataTable(cmd.CommandText, CommandType.Text);
        }
    }
}